//
//  JBViewController.m
//  JBPinYin
//
//  Created by YongbinZhang on 7/9/13.
//  Copyright (c) 2013 JustBen. All rights reserved.
//

#import "JBViewController.h"
#import "JBChineseAndPinYin.h"

@interface JBViewController ()

@end

@implementation JBViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
//    char var[2];
//    var[0] = '\0';
//    var[1] = '1';
//    NSLog(@"%zi", strlen(var));
    
//    NSString *str = [NSString stringWithUTF8String:var];
//
//    NSMutableArray *arr = [[NSMutableArray alloc] init];
//    [arr addObject:str];
//    [arr addObject:@"aAAA"];
//    [arr addObject:@"AAAA"];
//    [arr addObject:@"AAaA"];
//    [arr addObject:@"ABAA"];
//    [arr addObject:@"AbAA"];
//    [arr addObject:@"BBB"];
//    [arr addObject:@"BCB"];
//    [arr addObject:@"12S"];
//    [arr addObject:@"啊啊啊"];
//    [arr addObject:@"把"];
//    [arr addObject:@"中国"];
//    [arr addObject:@"中心"];
//    [arr addObject:@"中心力"];
//    [arr addObject:@"#"];
//    
//    NSLog(@"%@", [arr sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]);
    
    NSArray *ar = [NSArray arrayWithObjects:@"开源", @"中国", @"中国社区", @"OS中国", @"OSChina", @"123OSChina", @"(**)OSChina", nil];
//    for (NSDictionary *dic in [JBChineseAndPinYin ChineseAndPinYinArrayFromChineseDataSource:ar]) {
//        NSLog(@"%@, %@", [dic objectForKey:ChineseAndPinYinKeyChinese], [dic objectForKey:ChineseAndPinYinKeyPinYin]);
//    }
    
    NSLog(@"%@", [JBChineseAndPinYin SortedChineseAndPinYinArrayFromChineseDataSource:ar]);
    
//    for (NSDictionary *dic in [JBChineseAndPinYin SortedChineseAndPinYinArrayFromChineseDataSource:ar]) {
//        NSLog(@"char:%@", [dic objectForKey:SortedChineseAndPinYinKeyChar]);
//        NSLog(@"value:[");
//        for (NSDictionary *d in [dic.allValues lastObject]) {
//            NSLog(@"%@, %@", [d objectForKey:ChineseAndPinYinKeyChinese], [d objectForKey:ChineseAndPinYinKeyPinYin]);
//        }
//        NSLog(@"]");
//    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
